package shiro;


import org.apache.shiro.crypto.hash.SimpleHash;
import org.apache.shiro.util.ByteSource;

public class MD5Utils {
// 加密方式
    private static String hashAlgorithmName = "MD5";
//   累计次数
    private static Integer hashIterations = 7;
//    盐值
    private static ByteSource salt = ByteSource.Util.bytes("wlt");
//    通过原密码获得加密后密码
    public static String getMD5Pawword(String password){
        SimpleHash simpleHash = new SimpleHash(hashAlgorithmName, password, salt, hashIterations);
        return simpleHash.toString();
    }
}
